import turtle as t

def regular_polygon(edge,width,pen_color='black',pen_size=1,fill_color=None):
    if edge<3:
        raise Exception('多边形边数必须大于等于3')
    t.pensize(pen_size)
    t.color(pen_color,fill_color)
    t.begin_fill()
    for n in range(edge):
        t.fd(width)
        t.left(360/edge)
    t.end_fill()
    t.hideturtle()
